﻿using UnityEngine;
using System.Collections;
using UnityEditor;

public class AssetBundleEditor : Editor {


    [MenuItem("YdTools/SetBundleName")]
    public static void SetBundleName()
    {
        string[] list = { "Assets/Prefabs/Cube.prefab" };
        string[]deps= AssetDatabase.GetDependencies(list);
        foreach (string path in deps) {
            AssetImporter ai = AssetImporter.GetAtPath(path);
            ai.assetBundleName = path.ToLower() + Config.AB_PREFIX;

        }

    }

    [MenuItem("YdTools/BuildBundle")]
    public static void BuildBundle() {
        BuildPipeline.BuildAssetBundles("Assets/StreamingAssets");
    }
}
